extends AbstractContentResource
Dav accessible
A FileResource represents a file, such as an image or video. It will also represent HTML pages and there are methods for accessing the structured content within a HTML page, such as title, body and data parameters
Properties
Name | Returns | Notes | Example |
---|---|---|---|
cssPaths | List | ||
underlyingContentType | String | getContentType will return the content type of the data which will be generated for this request, which might be a transformation of the underlying data (eg transformed to JSON) getUnderlyingContentType returns the content type of the underlying data, which is invariant with respect to request information | |
html | RenderFileResource | Create an instance of a HTML renderable object to use with this file, if this file is a suitable type (ie is html) Note the ContentApp is responsible for locating these resources for the resource factory at the appropriate times. It will use a DocType to determine if a html file should be rendered with a template or raw | |
aBit | String | Get a bit of the file, probably the first line or so | |
title | String | The title from the HTML page, if there is one. Otherwise just the resource name | |
body | String | The body content of the HTML page, if this resource is a HTML page. Otherwise null | |
paramNames | List | Returns a list of all the script parameters for this page, if it is a HTML page | |
fileNode | FileNode | ||
textContent | String | Returns all of the text content of this resource. So this will be raw HTML for a HTML page | |
websiteBranch | WebsiteBranchResource | This returns the first parent resource which can report a domain name. If in admin console this might be a ManageWebsiteBranchFolder, or if viewed in a website it will be a WebsiteRootFolder | |
glyphicon | String |
Methods
Name | Returns | Notes | Example |
---|---|---|---|
getParam ( name ) | String | If this resource is a HTML page, this returns the script parameter with the given name A script parameter is defined in the head section of a HTML page in a script element, where the title attribute is the name of the parameter, and the element's type parameter is 'data/parameter' |
|
REST Operations
Update html properties
If this is a HTML page you can set its properties with form parameters:- template
- title
- body
Ask a question, or offer an answer